< previous page page_xv next page >

Page xv
Most of the programs should also run with little trouble in Visual Basic 5. To open a Visual Basic 6 program in Visual Basic 5, first edit the program's .vbp file using an editor such as Notepad. Find any lines that say ''Retained=0" and remove them. Save the file and open the program in Visual Basic 5.
Many examples will also run in Visual Basic 4, though translating them is harder. Open the project files in an editor, and cut and paste the code into a Visual Basic 4 project. You will need to add any necessary controls yourself. If you are running in a 16-bit environment such as Windows 3.1, you will need to translate any API functions the program needs into their 16-bit equivalents.
The OldSrc directory on the CD-ROM contains Visual Basic 4 source code from the previous edition of this book. Many of the examples still work and they may help you get started if you are using Visual Basic 4. They are provided "as-is" without any real support, however. Use them if you can; ignore them if you are using a later version of Visual Basic.
Few of the examples will port easily to earlier versions of Visual Basic. If you have an older version of Visual Basic, you should seriously consider upgrading to a more recent version. At least look at the Visual Basic 5 Control Creation Edition (CCE).
The Visual Basic 5 CCE lets you build programs and ActiveX controls much as Visual Basic 5 does. It will not let you create a compiled executable (.exe), but it will let you build a compiled ActiveX control (.ocx). Best of all, the CCE is available free on Microsoft's Web site. As of this writing, it is at http://msdn.microsoft.com/vbasic/downloads/cce. Microsoft often changes their links, however, so you may have to search to find the CCE's current location.
The example programs run at different speeds on different computers with different configurations. A 450MHz Pentium with 132Mb of memory will run much faster than a 486-based computer with 16Mb of memory (if such a computer can run Visual Basic anymore). You will quickly learn the limits of your hardware.
Chapter Overview
Visual Basic Graphics Programming is divided into five sections. Each covers a major topic in graphic programming.
Part One
Working with Windows
Part One describes beginning, intermediate, and advanced Visual Basic Windows programming. The techniques described in these chapters are used throughout the rest of the book.
Chapter 1, Visual Basics, covers the fundamentals of graphic programming in Visual Basic. If you are an experienced Visual Basic programmer, some of this material may be familiar to you. This chapter includes discussions of Visual Basic coordinates and scaling, custom coordinate systems, controls that can contain graphics, graphic methods and events, graphic properties, and the simple use of color. These topics form the foundation of any graphic program in Visual Basic.
Chapter 2, Using the API, discuses the use of the Windows Application Programming Interface (API). The API provides many powerful functions you can use to extend your

 
< previous page page_xv next page >